﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BobcatUtility
{
    /// <summary>
    /// This control shows one icon that can be hosted as part of the IconStripControl. It shows
    /// an image with a label, and raises an event when it's clicked. When you call setIcon to
    /// set up the image, you provide an ID. This string will be passed to event handlers when the
    /// control is clicked to identify it.
    /// </summary>
    public partial class IconControl : UserControl
    {
        #region Public properties

        /// <summary>
        /// Read-only property to return the ID (set in setIcon).
        /// </summary>
        public string ID 
        {
            get { return m_strID; }
        }

        #endregion

        #region Public methods

        /// <summary>
        /// Constructor.
        /// </summary>
        public IconControl()
        {
            InitializeComponent();
        }

        /// <summary>
        /// You pass in the image, label and unique ID for this icon.
        /// </summary>
        public void setIcon(Image image, string strLabel, string strID)
        {
            ctrlImage.Image = image;
            label.Text = strLabel;
            m_strID = strID;
        }

        #endregion

        #region Private data

        private string m_strID = "";

        #endregion

    }
}
